package frame.options.simulation.results.physicalNetworks.numerical;

import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;

import model.components.links.link.BandwidthBackupFlag;
import model.components.links.link.PhysicalLink;
import model.components.networks.network.PhysicalNetwork;
import model.components.nodes.comparator.NodeNumberComparator;
import model.components.nodes.node.Node;
import model.components.nodes.node.VirtualNode;
import model.components.nodes.node.PhysicalNode;
import model.components.nodes.node.VirtualRouter;
import model.components.nodes.node.PhysicalRouter;
import model.components.nodes.node.VirtualServer;
import model.components.nodes.node.PhysicalServer;
import model.components.nodes.node.VirtualSwitch;
import model.components.nodes.node.PhysicalSwitch;

@SuppressWarnings("serial")
public class PhysicalNetworkTable1 extends JTable
{
	private PhysicalNetwork physicalNetwork;
	public PhysicalNetwork getPhysicalNetwork(){ return physicalNetwork; }
	public void setPhysicalNetwork( PhysicalNetwork physicalNetwork ){ this.physicalNetwork = physicalNetwork; }

	private List< PhysicalRouter > physicalRouters;
	public List< PhysicalRouter > getPhysicalRouters(){ return physicalRouters; }
	public void setPhysicalRouters( List< PhysicalRouter > physicalRouters ){ this.physicalRouters = physicalRouters; }
	
	private List< PhysicalSwitch > physicalSwitches;
	public List< PhysicalSwitch > getPhysicalSwitches(){ return physicalSwitches; }
	public void setPhysicalSwitches( List< PhysicalSwitch > physicalSwitches ){ this.physicalSwitches = physicalSwitches; }
	
	private List< PhysicalServer > physicalServers;
	public List< PhysicalServer > getPhysicalServers(){ return physicalServers; }
	public void setPhysicalServers( List< PhysicalServer > physicalServers ){ this.physicalServers = physicalServers; }
	
	public PhysicalNetworkTable1( PhysicalNetwork physicalNetwork )
	{	
		this.setPhysicalNetwork( physicalNetwork );
		this.setPhysicalRouters( this.physicalRouters() );
		this.setPhysicalSwitches( this.physicalSwitches() );
		this.setPhysicalServers( this.physicalServers() );
		
		this.setModel( this.defaultTableModel() );
		this.setEnabled( false );
	}
	private List< PhysicalRouter > physicalRouters()
	{	
		List< PhysicalRouter > physicalRouters = new ArrayList< PhysicalRouter >();
		
		for( PhysicalNode physicalNode: this.getPhysicalNetwork().getPhysicalNodes() )
			if( physicalNode instanceof PhysicalRouter )
				physicalRouters.add( (PhysicalRouter) physicalNode );
		
		Collections.sort( physicalRouters, new NodeNumberComparator() );
		
		return physicalRouters;
	}
	private List< PhysicalSwitch > physicalSwitches()
	{	
		List< PhysicalSwitch > physicalSwitches = new ArrayList< PhysicalSwitch >();
		
		for( PhysicalNode physicalNode: this.getPhysicalNetwork().getPhysicalNodes() )
			if( physicalNode instanceof PhysicalSwitch )
				physicalSwitches.add( (PhysicalSwitch) physicalNode );
		
		Collections.sort( physicalSwitches, new NodeNumberComparator() );
		
		return physicalSwitches;
	}
	private List< PhysicalServer > physicalServers()
	{	
		List< PhysicalServer > physicalServers = new ArrayList< PhysicalServer >();
		
		for( PhysicalNode physicalNode: this.getPhysicalNetwork().getPhysicalNodes() )
			if( physicalNode instanceof PhysicalServer )
				physicalServers.add( (PhysicalServer) physicalNode );
		
		Collections.sort( physicalServers, new NodeNumberComparator() );
		
		return physicalServers;
	}
	
	private DefaultTableModel defaultTableModel()
	{
		DefaultTableModel defaultTableModel = new DefaultTableModel( new String[]{ "<html><b>RESOURCES</b></html>", "<html><b>PHYSICAL</b></html>", "<html><b>VIRTUAL</b></html>", "<html><b>ALLOCATION</b></html>" }, 0 );
				
		defaultTableModel.addRow( new Object[]{ "<html><b>LINKS</b></html>"} );
		
		if( this.physicalLinksNumber() > 0 )
			defaultTableModel.addRow( new Object[]{ "Number links", (int) this.physicalLinksNumber(), (int) this.virtualLinksNumber(), new DecimalFormat( "0.00" ).format( this.averageLinksNumber() ) + " %" } );
		
		if( this.bandwidthSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "<html><b>Bandwidth</b></html>"} );
		
		if( this.bandwidthSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "Bandwidth links", (int) this.bandwidthSubstrate(), (int) this.bandwidthRequest(), new DecimalFormat( "0.00" ).format( this.bandwidthAverage() ) + " %" } );
		
		defaultTableModel.addRow( new Object[]{ "<html><b>NODES</b></html>"} );
		
		if( this.numberRoutersSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "Number Routers", (int) this.numberRoutersSubstrate(), (int) this.numberRoutersRequest(), new DecimalFormat( "0.00" ).format( this.numberRoutersAverage() ) + " %" } );
		
		if( this.numberSwitchesSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "Number Switches", (int) this.numberSwitchesSubstrate(), (int) this.numberSwitchesRequest(), new DecimalFormat( "0.00" ).format( this.numberSwitchesAverage() ) + " %" } );
		
		if( this.numberServersSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "Number Servers", (int) this.numberServersSubstrate(), (int) this.numberServersRequest(), new DecimalFormat( "0.00" ).format( this.numberServersAverage() ) + " %" } );
		
		defaultTableModel.addRow( new Object[]{ "<html><b>Operating System</b></html>"} );
		
		if( this.linuxRoutersSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "Linux Routers", (int) this.linuxRoutersSubstrate(), (int) this.linuxRoutersRequest(), new DecimalFormat( "0.00" ).format( this.linuxRoutersAverage() ) + " %" } );
		
		if( this.linuxSwitchesSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "Linux Switches", (int) this.linuxSwitchesSubstrate(), (int) this.linuxSwitchesRequest(), new DecimalFormat( "0.00" ).format( this.linuxSwitchesAverage() ) + " %" } );
		
		if( this.linuxServersSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "Linux Servers", (int) this.linuxServersSubstrate(), (int) this.linuxServersRequest(), new DecimalFormat( "0.00" ).format( this.linuxServersAverage() ) + " %" } );
		
		if( this.windowsRoutersSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "Windows Routers", (int) this.windowsRoutersSubstrate(), (int) this.windowsRoutersRequest(), new DecimalFormat( "0.00" ).format( this.windowsRoutersAverage() ) + " %" } );
		
		if( this.windowsSwitchesSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "Windows Switches", (int) this.windowsSwitchesSubstrate(), (int) this.windowsSwitchesRequest(), new DecimalFormat( "0.00" ).format( this.windowsSwitchesAverage() ) + " %" } );
		
		if( this.windowsServersSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "Windows Servers", (int) this.windowsServersSubstrate(), (int) this.windowsServersRequest(), new DecimalFormat( "0.00" ).format( this.windowsServersAverage() ) + " %" } );
		
		if( this.solarisRoutersSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "Solaris Routers", (int) this.solarisRoutersSubstrate(), (int) this.solarisRoutersRequest(), new DecimalFormat( "0.00" ).format( this.solarisRoutersAverage() ) + " %" } );
		
		if( this.solarisSwitchesSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "Solaris Switches", (int) this.solarisSwitchesSubstrate(), (int) this.solarisSwitchesRequest(), new DecimalFormat( "0.00" ).format( this.solarisSwitchesAverage() ) + " %" } );
		
		if( this.solarisServersSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "Solaris Servers", (int) this.solarisServersSubstrate(), (int) this.solarisServersRequest(), new DecimalFormat( "0.00" ).format( this.solarisServersAverage() ) + " %" } );
		
		if( this.androidRoutersSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "Android Routers", (int) this.androidRoutersSubstrate(), (int) this.androidRoutersRequest(), new DecimalFormat( "0.00" ).format( this.androidRoutersAverage() ) + " %" } );
		
		if( this.androidSwitchesSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "Android Switches", (int) this.androidSwitchesSubstrate(), (int) this.androidSwitchesRequest(), new DecimalFormat( "0.00" ).format( this.androidSwitchesAverage() ) + " %" } );
		
		if( this.androidServersSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "Android Servers", (int) this.androidServersSubstrate(), (int) this.androidServersRequest(), new DecimalFormat( "0.00" ).format( this.androidServersAverage() ) + " %" } );
		
		defaultTableModel.addRow( new Object[]{ "<html><b>Virtual environment</b></html>"} );
		
		if( this.vmwareRoutersSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "VMWare Routers", (int) this.vmwareRoutersSubstrate(), (int) this.vmwareRoutersRequest(), new DecimalFormat( "0.00" ).format( this.vmwareRoutersAverage() ) + " %" } );
		
		if( this.vmwareSwitchesSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "VMWare Switches", (int) this.vmwareSwitchesSubstrate(), (int) this.vmwareSwitchesRequest(), new DecimalFormat( "0.00" ).format( this.vmwareSwitchesAverage() ) + " %" } );
		
		if( this.vmwareServersSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "VMWare Servers", (int) this.vmwareServersSubstrate(), (int) this.vmwareServersRequest(), new DecimalFormat( "0.00" ).format( this.vmwareServersAverage() ) + " %" } );
		
		if( this.xenRoutersSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "XEN Routers", (int) this.xenRoutersSubstrate(), (int) this.xenRoutersRequest(), new DecimalFormat( "0.00" ).format( this.xenRoutersAverage() ) + " %" } );
		
		if( this.xenSwitchesSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "XEN Switches", (int) this.xenSwitchesSubstrate(), (int) this.xenSwitchesRequest(), new DecimalFormat( "0.00" ).format( this.xenSwitchesAverage() ) + " %" } );
		
		if( this.xenServersSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "XEN Servers", (int) this.xenServersSubstrate(), (int) this.xenServersRequest(), new DecimalFormat( "0.00" ).format( this.xenServersAverage() ) + " %" } );
		
		if( this.kvmRoutersSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "KVM Routers", (int) this.kvmRoutersSubstrate(), (int) this.kvmRoutersRequest(), new DecimalFormat( "0.00" ).format( this.kvmRoutersAverage() ) + " %" } );
		
		if( this.kvmSwitchesSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "KVM Switches", (int) this.kvmSwitchesSubstrate(), (int) this.kvmSwitchesRequest(), new DecimalFormat( "0.00" ).format( this.kvmSwitchesAverage() ) + " %" } );
		
		if( this.kvmServersSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "KVM Servers", (int) this.kvmServersSubstrate(), (int) this.kvmServersRequest(), new DecimalFormat( "0.00" ).format( this.kvmServersAverage() ) + " %" } );
		
		if( this.umlRoutersSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "UML Routers", (int) this.umlRoutersSubstrate(), (int) this.umlRoutersRequest(), new DecimalFormat( "0.00" ).format( this.umlRoutersAverage() ) + " %" } );
		
		if( this.umlSwitchesSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "UML Switches", (int) this.umlSwitchesSubstrate(), (int) this.umlSwitchesRequest(), new DecimalFormat( "0.00" ).format( this.umlSwitchesAverage() ) + " %" } );
		
		if( this.umlServersSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "UML Servers", (int) this.umlServersSubstrate(), (int) this.umlServersRequest(), new DecimalFormat( "0.00" ).format( this.umlServersAverage() ) + " %" } );
		
		defaultTableModel.addRow( new Object[]{ "<html><b>CPU</b></html>"} );
		
		if( this.cpuRoutersSubstrate() > 0 )	
			defaultTableModel.addRow( new Object[]{ "CPU Routers", (int) this.cpuRoutersSubstrate(), (int) this.cpuRoutersRequest(), new DecimalFormat( "0.00" ).format( this.cpuRoutersAverage() ) + " %" } );
		
		if( this.cpuSwitchesSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "CPU Switches", (int) this.cpuSwitchesSubstrate(), (int) this.cpuSwitchesRequest(), new DecimalFormat( "0.00" ).format( this.cpuSwitchesAverage() ) + " %" } );
		
		if( this.cpuServersSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "CPU Servers", (int) this.cpuServersSubstrate(), (int) this.cpuServersRequest(), new DecimalFormat( "0.00" ).format( this.cpuServersAverage() ) + " %" } );
		
		defaultTableModel.addRow( new Object[]{ "<html><b>Memory</b></html>"} );
		
		if( this.memoryRoutersSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "Memory Routers", (int) this.memoryRoutersSubstrate(), (int) this.memoryRoutersRequest(), new DecimalFormat( "0.00" ).format( this.memoryRoutersAverage() ) + " %" } );
		
		if( this.memorySwitchesSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "Memory Switches", (int) this.memorySwitchesSubstrate(), (int) this.memorySwitchesRequest(), new DecimalFormat( "0.00" ).format( this.memorySwitchesAverage() ) + " %" } );
		
		if( this.memoryServersSubstrate() > 0 )
			defaultTableModel.addRow( new Object[]{ "Memory Servers", (int) this.memoryServersSubstrate(), (int) this.memoryServersRequest(), new DecimalFormat( "0.00" ).format( this.memoryServersAverage() ) + " %" } );
		
		defaultTableModel.addRow( new Object[]{ "<html><b>Disk Space</b></html>"} );
		
		if( this.physicalServersDiskSpace() > 0 )
			defaultTableModel.addRow( new Object[]{ "Disk Space Servers", (int) this.physicalServersDiskSpace(), (int) this.virtualServersDiskSpace(), new DecimalFormat( "0.00" ).format( this.diskSpaceServersAverage() ) + " %" } );
		
		return defaultTableModel;
	}
	
	private double physicalLinksNumber()
	{
		return this.getPhysicalNetwork().getLinks().size();
	}
	private double virtualLinksNumber()
	{
		double virtualLinksNumber = 0;
		
		for( PhysicalLink physicalLink: this.getPhysicalNetwork().getPhysicalLinks() )
			virtualLinksNumber += physicalLink.getVirtualLinksBandwidthsBackupFlags().size();
		
		return virtualLinksNumber;
	}
	private double averageLinksNumber()
	{
		if( this.physicalLinksNumber() == 0 )
			return 0;
		
		return 100 * ( this.virtualLinksNumber() / this.physicalLinksNumber() );
	}
	
	private double bandwidthSubstrate()
	{
		double bandwidthSubstrate = 0;
		
		for( PhysicalLink linkSubstrate: this.getPhysicalNetwork().getPhysicalLinks() )
			bandwidthSubstrate += linkSubstrate.getBandwidth();
		
		return bandwidthSubstrate;
	}
	private double bandwidthRequest()
	{
		double bandwidthRequest = 0;
		
		for( PhysicalLink linkSubstrate: this.getPhysicalNetwork().getPhysicalLinks() )
		{
			Iterator< BandwidthBackupFlag > iterator = linkSubstrate.getVirtualLinksBandwidthsBackupFlags().values().iterator();
			
			while( iterator.hasNext() )
				bandwidthRequest += iterator.next().getBandwidth();
		}
		
		return bandwidthRequest;
	}
	private double bandwidthAverage()
	{
		if( this.bandwidthSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.bandwidthRequest() / this.bandwidthSubstrate() );
	}

	private double numberRoutersSubstrate()
	{
		return this.getPhysicalRouters().size();
	}
	private double numberRoutersRequest()
	{
		double numberRoutersRequest = 0;
		
		for( PhysicalNode nodeSubstrate: this.getPhysicalNetwork().getPhysicalNodes() )
			for( VirtualNode nodeRequest: nodeSubstrate.getVirtualNodes() )
				if( nodeRequest instanceof VirtualRouter )
					numberRoutersRequest++;
		
		return numberRoutersRequest;
			
	}
	private double numberRoutersAverage()
	{
		if( this.numberRoutersSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.numberRoutersRequest() / this.numberRoutersSubstrate() );
	}
	
	private double numberSwitchesSubstrate()
	{
		return this.getPhysicalSwitches().size();
	}
	private double numberSwitchesRequest()
	{
		double numberSwitchesRequest = 0;
		
		for( PhysicalNode nodeSubstrate: this.getPhysicalNetwork().getPhysicalNodes() )
			for( VirtualNode nodeRequest: nodeSubstrate.getVirtualNodes() )
				if( nodeRequest instanceof VirtualSwitch )
					numberSwitchesRequest++;
		
		return numberSwitchesRequest;
	}
	private double numberSwitchesAverage()
	{
		if( this.numberSwitchesSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.numberSwitchesRequest() / this.numberSwitchesSubstrate() );
	}
	
	private double numberServersSubstrate()
	{
		return this.getPhysicalServers().size();
	}
	private double numberServersRequest()
	{
		double numberServersRequest = 0;
		
		for( PhysicalNode nodeSubstrate: this.getPhysicalNetwork().getPhysicalNodes() )
			for( VirtualNode nodeRequest: nodeSubstrate.getVirtualNodes() )
				if( nodeRequest instanceof VirtualServer )
					numberServersRequest++;
		
		return numberServersRequest;
	}
	private double numberServersAverage()
	{
		if( this.numberServersSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.numberServersRequest() / this.numberServersSubstrate() );
	}
	
	private double linuxRoutersSubstrate()
	{
		double linuxRoutersSubstrate = 0;
		
		for( PhysicalRouter routerSubstrate: this.getPhysicalRouters() )
			if( routerSubstrate.getOperatingSystem().equals( Node.LINUX_OS ) )
				linuxRoutersSubstrate++;
			
		return linuxRoutersSubstrate;
	}
	private double linuxRoutersRequest()
	{
		double linuxRoutersRequest = 0;
		
		for( PhysicalRouter routerSubstrate: this.getPhysicalRouters() )
			for( VirtualNode routerRequest: routerSubstrate.getVirtualNodes() )
				if( routerRequest.getOperatingSystem().equals( Node.LINUX_OS ) )
					linuxRoutersRequest++;
		
		return linuxRoutersRequest;
	}
	private double linuxRoutersAverage()
	{
		if( this.linuxRoutersSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.linuxRoutersRequest() / this.linuxRoutersSubstrate() );
	}
	
	private double linuxSwitchesSubstrate()
	{
		double linuxSwitchesSubstrate = 0;
		
		for( PhysicalSwitch switchSubstrate: this.getPhysicalSwitches() )
			if( switchSubstrate.getOperatingSystem().equals( Node.LINUX_OS ) )
				linuxSwitchesSubstrate++;
			
		return linuxSwitchesSubstrate;
	}
	private double linuxSwitchesRequest()
	{
		double linuxSwitchesRequest = 0;
		
		for( PhysicalSwitch switchSubstrate: this.getPhysicalSwitches() )
			for( VirtualNode switchRequest: switchSubstrate.getVirtualNodes() )
				if( switchRequest.getOperatingSystem().equals( Node.LINUX_OS ) )
					linuxSwitchesRequest++;
		
		return linuxSwitchesRequest;
	}
	private double linuxSwitchesAverage()
	{
		if( this.linuxSwitchesSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.linuxSwitchesRequest() / this.linuxSwitchesSubstrate() );
	}
	
	private double linuxServersSubstrate()
	{
		double linuxServersSubstrate = 0;
		
		for( PhysicalServer serverSubstrate: this.getPhysicalServers() )
			if( serverSubstrate.getOperatingSystem().equals( Node.LINUX_OS ) )
				linuxServersSubstrate++;
			
		return linuxServersSubstrate;
	}
	private double linuxServersRequest()
	{
		double linuxServersRequest = 0;
		
		for( PhysicalServer serverSubstrate: this.getPhysicalServers() )
			for( VirtualNode serverRequest: serverSubstrate.getVirtualNodes() )
				if( serverRequest.getOperatingSystem().equals( Node.LINUX_OS ) )
					linuxServersRequest++;
		
		return linuxServersRequest;
	}
	private double linuxServersAverage()
	{
		if( this.linuxServersSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.linuxServersRequest() / this.linuxServersSubstrate() );
	}

	private double windowsRoutersSubstrate()
	{
		double windowsRoutersSubstrate = 0;
		
		for( PhysicalRouter routerSubstrate: this.getPhysicalRouters() )
			if( routerSubstrate.getOperatingSystem().equals( Node.WINDOWS_OS ) )
				windowsRoutersSubstrate++;
			
		return windowsRoutersSubstrate;
	}
	private double windowsRoutersRequest()
	{
		double windowsRoutersRequest = 0;
		
		for( PhysicalRouter routerSubstrate: this.getPhysicalRouters() )
			for( VirtualNode routerRequest: routerSubstrate.getVirtualNodes() )
				if( routerRequest.getOperatingSystem().equals( Node.WINDOWS_OS ) )
					windowsRoutersRequest++;
		
		return windowsRoutersRequest;
	}
	private double windowsRoutersAverage()
	{
		if( this.windowsRoutersSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.windowsRoutersRequest() / this.windowsRoutersSubstrate() );
	}
	
	private double windowsSwitchesSubstrate()
	{
		double windowsSwitchesSubstrate = 0;
		
		for( PhysicalSwitch switchSubstrate: this.getPhysicalSwitches() )
			if( switchSubstrate.getOperatingSystem().equals( Node.WINDOWS_OS ) )
				windowsSwitchesSubstrate++;
			
		return windowsSwitchesSubstrate;
	}
	private double windowsSwitchesRequest()
	{
		double windowsSwitchesRequest = 0;
		
		for( PhysicalSwitch switchSubstrate: this.getPhysicalSwitches() )
			for( VirtualNode switchRequest: switchSubstrate.getVirtualNodes() )
				if( switchRequest.getOperatingSystem().equals( Node.WINDOWS_OS ) )
					windowsSwitchesRequest++;
		
		return windowsSwitchesRequest;
	}
	private double windowsSwitchesAverage()
	{
		if( this.windowsSwitchesSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.windowsSwitchesRequest() / this.windowsSwitchesSubstrate() );
	}
	
	private double windowsServersSubstrate()
	{
		double windowsServersSubstrate = 0;
		
		for( PhysicalServer serverSubstrate: this.getPhysicalServers() )
			if( serverSubstrate.getOperatingSystem().equals( Node.WINDOWS_OS ) )
				windowsServersSubstrate++;
			
		return windowsServersSubstrate;
	}
	private double windowsServersRequest()
	{
		double windowsServersRequest = 0;
		
		for( PhysicalServer serverSubstrate: this.getPhysicalServers() )
			for( VirtualNode serverRequest: serverSubstrate.getVirtualNodes() )
				if( serverRequest.getOperatingSystem().equals( Node.WINDOWS_OS ) )
					windowsServersRequest++;
		
		return windowsServersRequest;
	}
	private double windowsServersAverage()
	{
		if( this.windowsServersSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.windowsServersRequest() / this.windowsServersSubstrate() );
	}

	private double solarisRoutersSubstrate()
	{
		double solarisRoutersSubstrate = 0;
		
		for( PhysicalRouter routerSubstrate: this.getPhysicalRouters() )
			if( routerSubstrate.getOperatingSystem().equals( Node.SOLARIS_OS ) )
				solarisRoutersSubstrate++;
			
		return solarisRoutersSubstrate;
	}
	private double solarisRoutersRequest()
	{
		double solarisRoutersRequest = 0;
		
		for( PhysicalRouter routerSubstrate: this.getPhysicalRouters() )
			for( VirtualNode routerRequest: routerSubstrate.getVirtualNodes() )
				if( routerRequest.getOperatingSystem().equals( Node.SOLARIS_OS ) )
					solarisRoutersRequest++;
		
		return solarisRoutersRequest;
	}
	private double solarisRoutersAverage()
	{
		if( this.solarisRoutersSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.solarisRoutersRequest() / this.solarisRoutersSubstrate() );
	}
	
	private double solarisSwitchesSubstrate()
	{
		double solarisSwitchesSubstrate = 0;
		
		for( PhysicalSwitch switchSubstrate: this.getPhysicalSwitches() )
			if( switchSubstrate.getOperatingSystem().equals( Node.SOLARIS_OS ) )
				solarisSwitchesSubstrate++;
			
		return solarisSwitchesSubstrate;
	}
	private double solarisSwitchesRequest()
	{
		double solarisSwitchesRequest = 0;
		
		for( PhysicalSwitch switchSubstrate: this.getPhysicalSwitches() )
			for( VirtualNode switchRequest: switchSubstrate.getVirtualNodes() )
				if( switchRequest.getOperatingSystem().equals( Node.SOLARIS_OS ) )
					solarisSwitchesRequest++;
		
		return solarisSwitchesRequest;
	}
	private double solarisSwitchesAverage()
	{
		if( this.solarisSwitchesSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.solarisSwitchesRequest() / this.solarisSwitchesSubstrate() );
	}
	
	private double solarisServersSubstrate()
	{
		double solarisServersSubstrate = 0;
		
		for( PhysicalServer serverSubstrate: this.getPhysicalServers() )
			if( serverSubstrate.getOperatingSystem().equals( Node.SOLARIS_OS ) )
				solarisServersSubstrate++;
			
		return solarisServersSubstrate;
	}
	private double solarisServersRequest()
	{
		double solarisServersRequest = 0;
		
		for( PhysicalServer serverSubstrate: this.getPhysicalServers() )
			for( VirtualNode serverRequest: serverSubstrate.getVirtualNodes() )
				if( serverRequest.getOperatingSystem().equals( Node.SOLARIS_OS ) )
					solarisServersRequest++;
		
		return solarisServersRequest;
	}
	private double solarisServersAverage()
	{
		if( this.solarisServersSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.solarisServersRequest() / this.solarisServersSubstrate() );
	}

	private double androidRoutersSubstrate()
	{
		double androidRoutersSubstrate = 0;
		
		for( PhysicalRouter routerSubstrate: this.getPhysicalRouters() )
			if( routerSubstrate.getOperatingSystem().equals( Node.ANDROID_OS ) )
				androidRoutersSubstrate++;
			
		return androidRoutersSubstrate;
	}
	private double androidRoutersRequest()
	{
		double androidRoutersRequest = 0;
		
		for( PhysicalRouter routerSubstrate: this.getPhysicalRouters() )
			for( VirtualNode routerRequest: routerSubstrate.getVirtualNodes() )
				if( routerRequest.getOperatingSystem().equals( Node.ANDROID_OS ) )
					androidRoutersRequest++;
		
		return androidRoutersRequest;
	}
	private double androidRoutersAverage()
	{
		if( this.androidRoutersSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.androidRoutersRequest() / this.androidRoutersSubstrate() );
	}
	
	private double androidSwitchesSubstrate()
	{
		double androidSwitchesSubstrate = 0;
		
		for( PhysicalSwitch switchSubstrate: this.getPhysicalSwitches() )
			if( switchSubstrate.getOperatingSystem().equals( Node.ANDROID_OS ) )
				androidSwitchesSubstrate++;
			
		return androidSwitchesSubstrate;
	}
	private double androidSwitchesRequest()
	{
		double androidSwitchesRequest = 0;
		
		for( PhysicalSwitch switchSubstrate: this.getPhysicalSwitches() )
			for( VirtualNode switchRequest: switchSubstrate.getVirtualNodes() )
				if( switchRequest.getOperatingSystem().equals( Node.ANDROID_OS ) )
					androidSwitchesRequest++;
		
		return androidSwitchesRequest;
	}
	private double androidSwitchesAverage()
	{
		if( this.androidSwitchesSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.androidSwitchesRequest() / this.androidSwitchesSubstrate() );
	}
	
	private double androidServersSubstrate()
	{
		double androidServersSubstrate = 0;
		
		for( PhysicalServer serverSubstrate: this.getPhysicalServers() )
			if( serverSubstrate.getOperatingSystem().equals( Node.ANDROID_OS ) )
				androidServersSubstrate++;
			
		return androidServersSubstrate;
	}
	private double androidServersRequest()
	{
		double androidServersRequest = 0;
		
		for( PhysicalServer serverSubstrate: this.getPhysicalServers() )
			for( VirtualNode serverRequest: serverSubstrate.getVirtualNodes() )
				if( serverRequest.getOperatingSystem().equals( Node.ANDROID_OS ) )
					androidServersRequest++;
		
		return androidServersRequest;
	}
	private double androidServersAverage()
	{
		if( this.androidServersSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.androidServersRequest() / this.androidServersSubstrate() );
	}

	private double vmwareRoutersSubstrate()
	{
		double vmwareRoutersSubstrate = 0;
		
		for( PhysicalRouter routerSubstrate: this.getPhysicalRouters() )
			if( routerSubstrate.getVirtualEnvironment().equals( Node.VMWARE_VE ) )
				vmwareRoutersSubstrate++;
			
		return vmwareRoutersSubstrate;
	}
	private double vmwareRoutersRequest()
	{
		double vmwareRoutersRequest = 0;
		
		for( PhysicalRouter routerSubstrate: this.getPhysicalRouters() )
			for( VirtualNode routerRequest: routerSubstrate.getVirtualNodes() )
				if( routerRequest.getVirtualEnvironment().equals( Node.VMWARE_VE ) )
					vmwareRoutersRequest++;
		
		return vmwareRoutersRequest;
	}
	private double vmwareRoutersAverage()
	{
		if( this.vmwareRoutersSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.vmwareRoutersRequest() / this.vmwareRoutersSubstrate() );
	}
	
	private double vmwareSwitchesSubstrate()
	{
		double vmwareSwitchesSubstrate = 0;
		
		for( PhysicalSwitch switchSubstrate: this.getPhysicalSwitches() )
			if( switchSubstrate.getVirtualEnvironment().equals( Node.VMWARE_VE ) )
				vmwareSwitchesSubstrate++;
			
		return vmwareSwitchesSubstrate;
	}
	private double vmwareSwitchesRequest()
	{
		double vmwareSwitchesRequest = 0;
		
		for( PhysicalSwitch switchSubstrate: this.getPhysicalSwitches() )
			for( VirtualNode switchRequest: switchSubstrate.getVirtualNodes() )
				if( switchRequest.getVirtualEnvironment().equals( Node.VMWARE_VE ) )
					vmwareSwitchesRequest++;
		
		return vmwareSwitchesRequest;
	}
	private double vmwareSwitchesAverage()
	{
		if( this.vmwareSwitchesSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.vmwareSwitchesRequest() / this.vmwareSwitchesSubstrate() );
	}
	
	private double vmwareServersSubstrate()
	{
		double vmwareServersSubstrate = 0;
		
		for( PhysicalServer serverSubstrate: this.getPhysicalServers() )
			if( serverSubstrate.getVirtualEnvironment().equals( Node.VMWARE_VE ) )
				vmwareServersSubstrate++;
			
		return vmwareServersSubstrate;
	}
	private double vmwareServersRequest()
	{
		double vmwareServersRequest = 0;
		
		for( PhysicalServer serverSubstrate: this.getPhysicalServers() )
			for( VirtualNode serverRequest: serverSubstrate.getVirtualNodes() )
				if( serverRequest.getVirtualEnvironment().equals( Node.VMWARE_VE ) )
					vmwareServersRequest++;
		
		return vmwareServersRequest;
	}
	private double vmwareServersAverage()
	{
		if( this.vmwareServersSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.vmwareServersRequest() / this.vmwareServersSubstrate() );
	}

	private double xenRoutersSubstrate()
	{
		double xenRoutersSubstrate = 0;
		
		for( PhysicalRouter routerSubstrate: this.getPhysicalRouters() )
			if( routerSubstrate.getVirtualEnvironment().equals( Node.XEN_VE ) )
				xenRoutersSubstrate++;
			
		return xenRoutersSubstrate;
	}
	private double xenRoutersRequest()
	{
		double xenRoutersRequest = 0;
		
		for( PhysicalRouter routerSubstrate: this.getPhysicalRouters() )
			for( VirtualNode routerRequest: routerSubstrate.getVirtualNodes() )
				if( routerRequest.getVirtualEnvironment().equals( Node.XEN_VE ) )
					xenRoutersRequest++;
		
		return xenRoutersRequest;
	}
	private double xenRoutersAverage()
	{
		if( this.xenRoutersSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.xenRoutersRequest() / this.xenRoutersSubstrate() );
	}
	
	private double xenSwitchesSubstrate()
	{
		double xenSwitchesSubstrate = 0;
		
		for( PhysicalSwitch switchSubstrate: this.getPhysicalSwitches() )
			if( switchSubstrate.getVirtualEnvironment().equals( Node.XEN_VE ) )
				xenSwitchesSubstrate++;
			
		return xenSwitchesSubstrate;
	}
	private double xenSwitchesRequest()
	{
		double xenSwitchesRequest = 0;
		
		for( PhysicalSwitch switchSubstrate: this.getPhysicalSwitches() )
			for( VirtualNode switchRequest: switchSubstrate.getVirtualNodes() )
				if( switchRequest.getVirtualEnvironment().equals( Node.XEN_VE ) )
					xenSwitchesRequest++;
		
		return xenSwitchesRequest;
	}
	private double xenSwitchesAverage()
	{
		if( this.xenSwitchesSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.xenSwitchesRequest() / this.xenSwitchesSubstrate() );
	}
	
	private double xenServersSubstrate()
	{
		double xenServersSubstrate = 0;
		
		for( PhysicalServer serverSubstrate: this.getPhysicalServers() )
			if( serverSubstrate.getVirtualEnvironment().equals( Node.XEN_VE ) )
				xenServersSubstrate++;
			
		return xenServersSubstrate;
	}
	private double xenServersRequest()
	{
		double xenServersRequest = 0;
		
		for( PhysicalServer serverSubstrate: this.getPhysicalServers() )
			for( VirtualNode serverRequest: serverSubstrate.getVirtualNodes() )
				if( serverRequest.getVirtualEnvironment().equals( Node.XEN_VE ) )
					xenServersRequest++;
		
		return xenServersRequest;
	}
	private double xenServersAverage()
	{
		if( this.xenServersSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.xenServersRequest() / this.xenServersSubstrate() );
	}

	private double kvmRoutersSubstrate()
	{
		double kvmRoutersSubstrate = 0;
		
		for( PhysicalRouter routerSubstrate: this.getPhysicalRouters() )
			if( routerSubstrate.getVirtualEnvironment().equals( Node.KVM_VE ) )
				kvmRoutersSubstrate++;
			
		return kvmRoutersSubstrate;
	}
	private double kvmRoutersRequest()
	{
		double kvmRoutersRequest = 0;
		
		for( PhysicalRouter routerSubstrate: this.getPhysicalRouters() )
			for( VirtualNode routerRequest: routerSubstrate.getVirtualNodes() )
				if( routerRequest.getVirtualEnvironment().equals( Node.KVM_VE ) )
					kvmRoutersRequest++;
		
		return kvmRoutersRequest;
	}
	private double kvmRoutersAverage()
	{
		if( this.kvmRoutersSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.kvmRoutersRequest() / this.kvmRoutersSubstrate() );
	}
	
	private double kvmSwitchesSubstrate()
	{
		double kvmSwitchesSubstrate = 0;
		
		for( PhysicalSwitch switchSubstrate: this.getPhysicalSwitches() )
			if( switchSubstrate.getVirtualEnvironment().equals( Node.KVM_VE ) )
				kvmSwitchesSubstrate++;
			
		return kvmSwitchesSubstrate;
	}
	private double kvmSwitchesRequest()
	{
		double kvmSwitchesRequest = 0;
		
		for( PhysicalSwitch switchSubstrate: this.getPhysicalSwitches() )
			for( VirtualNode switchRequest: switchSubstrate.getVirtualNodes() )
				if( switchRequest.getVirtualEnvironment().equals( Node.KVM_VE ) )
					kvmSwitchesRequest++;
		
		return kvmSwitchesRequest;
	}
	private double kvmSwitchesAverage()
	{
		if( this.kvmSwitchesSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.kvmSwitchesRequest() / this.kvmSwitchesSubstrate() );
	}
	
	private double kvmServersSubstrate()
	{
		double kvmServersSubstrate = 0;
		
		for( PhysicalServer serverSubstrate: this.getPhysicalServers() )
			if( serverSubstrate.getVirtualEnvironment().equals( Node.KVM_VE ) )
				kvmServersSubstrate++;
			
		return kvmServersSubstrate;
	}
	private double kvmServersRequest()
	{
		double kvmServersRequest = 0;
		
		for( PhysicalServer serverSubstrate: this.getPhysicalServers() )
			for( VirtualNode serverRequest: serverSubstrate.getVirtualNodes() )
				if( serverRequest.getVirtualEnvironment().equals( Node.KVM_VE ) )
					kvmServersRequest++;
		
		return kvmServersRequest;
	}
	private double kvmServersAverage()
	{
		if( this.kvmServersSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.kvmServersRequest() / this.kvmServersSubstrate() );
	}

	private double umlRoutersSubstrate()
	{
		double umlRoutersSubstrate = 0;
		
		for( PhysicalRouter routerSubstrate: this.getPhysicalRouters() )
			if( routerSubstrate.getVirtualEnvironment().equals( Node.UML_VE ) )
				umlRoutersSubstrate++;
			
		return umlRoutersSubstrate;
	}
	private double umlRoutersRequest()
	{
		double umlRoutersRequest = 0;
		
		for( PhysicalRouter routerSubstrate: this.getPhysicalRouters() )
			for( VirtualNode routerRequest: routerSubstrate.getVirtualNodes() )
				if( routerRequest.getVirtualEnvironment().equals( Node.UML_VE ) )
					umlRoutersRequest++;
		
		return umlRoutersRequest;
	}
	private double umlRoutersAverage()
	{
		if( this.umlRoutersSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.umlRoutersRequest() / this.umlRoutersSubstrate() );
	}
	
	private double umlSwitchesSubstrate()
	{
		double umlSwitchesSubstrate = 0;
		
		for( PhysicalSwitch switchSubstrate: this.getPhysicalSwitches() )
			if( switchSubstrate.getVirtualEnvironment().equals( Node.UML_VE ) )
				umlSwitchesSubstrate++;
			
		return umlSwitchesSubstrate;
	}
	private double umlSwitchesRequest()
	{
		double umlSwitchesRequest = 0;
		
		for( PhysicalSwitch switchSubstrate: this.getPhysicalSwitches() )
			for( VirtualNode switchRequest: switchSubstrate.getVirtualNodes() )
				if( switchRequest.getVirtualEnvironment().equals( Node.UML_VE ) )
					umlSwitchesRequest++;
		
		return umlSwitchesRequest;
	}
	private double umlSwitchesAverage()
	{
		if( this.umlSwitchesSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.umlSwitchesRequest() / this.umlSwitchesSubstrate() );
	}
	
	private double umlServersSubstrate()
	{
		double umlServersSubstrate = 0;
		
		for( PhysicalServer serverSubstrate: this.getPhysicalServers() )
			if( serverSubstrate.getVirtualEnvironment().equals( Node.UML_VE ) )
				umlServersSubstrate++;
			
		return umlServersSubstrate;
	}
	private double umlServersRequest()
	{
		double umlServersRequest = 0;
		
		for( PhysicalServer serverSubstrate: this.getPhysicalServers() )
			for( VirtualNode serverRequest: serverSubstrate.getVirtualNodes() )
				if( serverRequest.getVirtualEnvironment().equals( Node.UML_VE ) )
					umlServersRequest++;
		
		return umlServersRequest;
	}
	private double umlServersAverage()
	{
		if( this.umlServersSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.umlServersRequest() / this.umlServersSubstrate() );
	}
	
	private double cpuRoutersSubstrate()
	{
		double cpuRoutersSubstrate = 0;
		
		for( PhysicalRouter routerSubstrate: this.getPhysicalRouters() )
			cpuRoutersSubstrate += routerSubstrate.getCpu();
			
		return cpuRoutersSubstrate;
	}
	private double cpuRoutersRequest()
	{
		double cpuRoutersRequest = 0;
		
		for( PhysicalRouter routerSubstrate: this.getPhysicalRouters() )
			for( VirtualNode routerRequest: routerSubstrate.getVirtualNodes() )
				cpuRoutersRequest += routerRequest.getCpu();
		
		return cpuRoutersRequest;
	}
	private double cpuRoutersAverage()
	{
		if( this.cpuRoutersSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.cpuRoutersRequest() / this.cpuRoutersSubstrate() );
	}
	
	private double cpuSwitchesSubstrate()
	{
		double cpuSwitchesSubstrate = 0;
		
		for( PhysicalSwitch switchSubstrate: this.getPhysicalSwitches() )
			cpuSwitchesSubstrate += switchSubstrate.getCpu();
			
		return cpuSwitchesSubstrate;
	}
	private double cpuSwitchesRequest()
	{
		double cpuSwitchesRequest = 0;
		
		for( PhysicalSwitch switchSubstrate: this.getPhysicalSwitches() )
			for( VirtualNode switchRequest: switchSubstrate.getVirtualNodes() )
				cpuSwitchesRequest += switchRequest.getCpu();
		
		return cpuSwitchesRequest;
	}
	private double cpuSwitchesAverage()
	{
		if( this.cpuSwitchesSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.cpuSwitchesRequest() / this.cpuSwitchesSubstrate() );
	}
	
	private double cpuServersSubstrate()
	{
		double cpuServersSubstrate = 0;
		
		for( PhysicalServer serverSubstrate: this.getPhysicalServers() )
			cpuServersSubstrate += serverSubstrate.getCpu();
			
		return cpuServersSubstrate;
	}
	private double cpuServersRequest()
	{
		double cpuServersRequest = 0;
		
		for( PhysicalServer serverSubstrate: this.getPhysicalServers() )
			for( VirtualNode serverRequest: serverSubstrate.getVirtualNodes() )
				cpuServersRequest += serverRequest.getCpu();
		
		return cpuServersRequest;
	}
	private double cpuServersAverage()
	{
		if( this.cpuServersSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.cpuServersRequest() / this.cpuServersSubstrate() );
	}

	private double memoryRoutersSubstrate()
	{
		double memoryRoutersSubstrate = 0;
		
		for( PhysicalRouter routerSubstrate: this.getPhysicalRouters() )
			memoryRoutersSubstrate += routerSubstrate.getMemory();
			
		return memoryRoutersSubstrate;
	}
	private double memoryRoutersRequest()
	{
		double memoryRoutersRequest = 0;
		
		for( PhysicalRouter routerSubstrate: this.getPhysicalRouters() )
			for( VirtualNode router: routerSubstrate.getVirtualNodes() )
				memoryRoutersRequest += router.getMemory();
		
		return memoryRoutersRequest;
	}
	private double memoryRoutersAverage()
	{
		if( this.memoryRoutersSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.memoryRoutersRequest() / this.memoryRoutersSubstrate() );
	}
	
	private double memorySwitchesSubstrate()
	{
		double memorySwitchesSubstrate = 0;
		
		for( PhysicalSwitch switchSubstrate: this.getPhysicalSwitches() )
			memorySwitchesSubstrate += switchSubstrate.getMemory();
			
		return memorySwitchesSubstrate;
	}
	private double memorySwitchesRequest()
	{
		double memorySwitchesRequest = 0;
		
		for( PhysicalSwitch switchSubstrate: this.getPhysicalSwitches() )
			for( VirtualNode switchRequest: switchSubstrate.getVirtualNodes() )
				memorySwitchesRequest += switchRequest.getMemory();
		
		return memorySwitchesRequest;
	}
	private double memorySwitchesAverage()
	{
		if( this.memorySwitchesSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.memorySwitchesRequest() / this.memorySwitchesSubstrate() );
	}
	
	private double memoryServersSubstrate()
	{
		double memoryServersSubstrate = 0;
		
		for( PhysicalServer serverSubstrate: this.getPhysicalServers() )
			memoryServersSubstrate += serverSubstrate.getMemory();
			
		return memoryServersSubstrate;
	}
	private double memoryServersRequest()
	{
		double memoryServersRequest = 0;
		
		for( PhysicalServer serverSubstrate: this.getPhysicalServers() )
			for( VirtualNode serverRequest: serverSubstrate.getVirtualNodes() )
				memoryServersRequest += serverRequest.getMemory();
		
		return memoryServersRequest;
	}
	private double memoryServersAverage()
	{
		if( this.memoryServersSubstrate() == 0 )
			return 0;
		
		return 100 * ( this.memoryServersRequest() / this.memoryServersSubstrate() );
	}
	
	private double physicalServersDiskSpace()
	{
		double physicalServersDiskSpace = 0;
		
		for( PhysicalServer serverSubstrate: this.getPhysicalServers() )
			physicalServersDiskSpace += serverSubstrate.getDiskSpace();
			
		return physicalServersDiskSpace;
	}
	private double virtualServersDiskSpace()
	{
		double virtualServersDiskSpace = 0;
		
		for( PhysicalServer serverSubstrate: this.getPhysicalServers() )
			for( VirtualNode serverRequest: serverSubstrate.getVirtualNodes() )
				virtualServersDiskSpace += serverRequest.getDiskSpace();
		
		return virtualServersDiskSpace;
	}
	private double diskSpaceServersAverage()
	{
		if( this.physicalServersDiskSpace() == 0 )
			return 0;
		
		return 100 * ( this.virtualServersDiskSpace() / this.physicalServersDiskSpace() );
	}
	
}
